package demo1;

/**
 * @Author 12629
 * @Description：
 */
class B {
    public B() {
        // do nothing
        func(); // 会调用子类的func
    }
    public void func() {
        System.out.println("B.func()");
    }
}







class D extends B {

    private int num = 1;

    D() {
        super();
    }
    @Override
    public void func() {
        //0
        System.out.println("D.func() " + num);
    }
}
public class Test2 {
    public static void main(String[] args) {
        D d = new D();

        //List<String> list = new ArrayList<>(); 发生了
    }
}
